﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EffectManager
{
    private static EffectManager _instance;

    public static EffectManager Instance
    {
        get
        {
            if (null == _instance)
            {
                _instance = new EffectManager();
            }
            return _instance;
        }
    }

    private EffectManager()
    {
        _instance = this;
    }

    public GameObject Create(string name, Vector3 position)
    {
        GameObject go = ResourceManager.Instantiate("Effect/" + name);
        go.GetComponent<EffectController>().Init(position, position);
        return go;
    }

    public GameObject Create(string name, Vector3 start, Vector3 end)
    {
        GameObject go = ResourceManager.Instantiate("Effect/" + name);

        go.GetComponent<EffectController>().Init(start, end);
        return go;
    }
}